<<<<<<< .mine
<?php
class Admin_AbiturientController
    extends Admin_Abstract
{
    public function saveAction()
    {
        $this->_permision('abiturient');
        $data = $this->getRequest()->getParam('abiturient',array());
        $model = new Model_Abiturient_Item();

        if(isset($data['id'])) {
            $model->load($data['id']);
            unset($data['id']);
        }

        foreach ($data as $key=>$value) {
            $model->setData($key,$value);
        }
        
        try {
            $model->save();
            $this->_getSession()->addSuccess('Data saved');
        } catch (Exception $e) {
            $this->_getSession()->addError($e->getMessage());
        }
        $this->_redirect('admin/abiturient/index/');
    }

    public function viewAction()
    {
        $this->_permision('abiturient');
        $this->loadLayout();
        $this->renderLayout();
    }

    public function indexAction()
    {
        $this->_permision('abiturient');
        $this->loadLayout();
        $this->renderLayout();
    }

    public function deleteAction()
    {
        $this->_permision('abiturient');
        $item = $this->getRequest()->getParam('item',null);
        try {
            if(!empty($item)) {
                if(is_array($item)) {
                    foreach ($item as $_item) {
                        $model = new Model_Abiturient_Item();
                        $model->load($_item);
                        $model->delete();
                    }
                } else {
                    $model = new Model_Abiturient_Item();
                    $model->load($item);
                    $model->delete();
                }
                $this->_getSession()->addSuccess('Item deleted');
            }
        } catch (Exception $e) {
            $this->_getSession()->addError($e->getMessage());
        }
        $this->_redirect('admin/abiturient/index/');
    }
}=======
<?php
class Admin_AbiturientController
    extends Admin_Abstract
{
    public function saveAction()
    {
        $this->_permision('abiturient');
        $abiturientModel = new Zend_Db_Table('abiturient_entity');
        $abiturientEav = new Model_Abiturient_Abiturient($abiturientModel);

        $products = $abiturientModel->find(array(1));

        foreach ($products as $product) {
            $abiturientEav->setOptionValue($product, 'firstname', 'Роман');
            $abiturientEav->setOptionValue($product, 'lastname', 'Томчак');
            $abiturientEav->setOptionValue($product, 'description', 'Мій опис');
        }
    }

    public function viewAction()
    {
        $this->_permision('abiturient');
        $this->loadLayout();
        $this->renderLayout();
    }

    public function indexAction()
    {
        $this->_permision('abiturient');
        $this->loadLayout();
        $this->renderLayout();
    }

    public function testsaveAction()
    {
//        $model = new Model_Abiturient_Item();
//        $model->load(1);
//        $model->delete();
        $collection = new Model_Abiturient_Resource_Item_Collection();
        $collection->load();
        $items = $collection->getItems();
    }
}>>>>>>> .r7
